﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="listcontent.ascx.cs" Inherits="mwc_admin_controls_listcontent" %>
<div style="padding:10px; background-color:White;">
    <p style="font-weight:bold;font-size:12pt;">List of article: </p>
    <asp:sqldatasource id="MwcContent"
      selectcommand="SELECT * FROM mwc_content"
      connectionstring="server=localhost;UID=sa;PWD=123456;database=mwc_maeglerteam1" 
      runat="server"/>

    <asp:GridView ID="gvListContent" runat="server"
        DataSourceID="MwcContent"
        AutoGenerateColumns="false"
        EmptyDataText="There no article"
        AllowPaging="true"
        DataKeyNames="id" Width="100%" >
        <Columns>
            <asp:BoundField ItemStyle-Width="5%"  DataField="id" HeaderText="ID" InsertVisible="false" ReadOnly="true" SortExpression="id" />

            <asp:BoundField ItemStyle-Wrap="true" DataField="title" HeaderText="Title" InsertVisible="false" ReadOnly="true" SortExpression="title" />

            <asp:BoundField ItemStyle-Width="10%" DataField="enable" HeaderText="Enable" InsertVisible="false" ReadOnly="true" SortExpression="enable" />
        
            <asp:HyperLinkField ItemStyle-Width="10%" HeaderText="Edit" Text="Change" DataNavigateUrlFields="id" DataNavigateUrlFormatString="~/mwc_admin/Panel.aspx?option=editcontent&id={0}" />
        </Columns>  

    </asp:GridView>
</div>
